Dot products

Lecture 15

Author
Affiliation

Minjae Park

Auburn University
MATH 2660 - Spring 2026

Published

February 13, 2026

Recap

Linear Independence

  • A set \(\{\vec{v}_1,\ldots,\vec{v}_k\}\) is linearly dependent if there exist scalars \(c_1,\ldots,c_k\), not all zero, such that \[ c_1\vec{v}_1+\cdots+c_k\vec{v}_k=\vec{0}. \]
  • Equivalently, at least one vector can be written as a linear combination of the others.
  • If the only solution is \(c_1=\cdots=c_k=0\), the vectors are linearly independent.

Basis and Dimension

  • Let \(V\) be a vector space. A set \(S\) is a basis of \(V\) if it is a linearly independent spanning set.
  • The number of vectors in a basis is called the dimension of \(V\), denoted by \(\dim(V)\).
  • Although a vector space may have many different bases, they all have the same number of vectors.
  • The set \(S=\{\vec{e}_1,\ldots,\vec{e}_n\}\) is called the standard basis of \(\mathbb{R}^n\).

Exercise

  • Let \(V\) be the set of \(3\times 3\) upper triangular matrices. What is \(\dim(V)\)?

Scan the QR code or go to join.iclicker.com/MBNJ.

Dot Products

Motivating Example

  • The sets \(\{\langle 1,0 \rangle,\langle 0,1 \rangle\}\) and \(\{\langle 2,0 \rangle,\langle 1,2 \rangle\}\) both span \(\mathbb{R}^2\).
  • Which basis looks “better”?
  • The first one is preferable because:
    • Each vector has length \(1\), so coordinates directly measure how far we move in that direction.
    • The angle between them is \(90^\circ\), so motion in one direction does not affect the other.
  • In the second set, the vectors are not perpendicular, so movement in one direction has a component in the other.

Motivation: Measuring Vectors

  • A basis of a vector space is not unique.
  • Can we choose a “better” basis?
  • Ideally, we want unit vectors that are perpendicular to each other.
  • To formalize this idea, we need a way to measure lengths and angles.

Dot Product

  • The dot product (also called the scalar product or inner product) is an operation defined for two vectors \(\vec{u},\vec{v}\in\mathbb{R}^n\).
  • The result is a scalar (a real number).
  • If \(\vec{u}=\langle u_1,\ldots,u_n \rangle\) and \(\vec{v}=\langle v_1,\ldots,v_n \rangle\), then \[ \vec{u}\!\cdot\!\vec{v}=u_1v_1+\cdots+u_nv_n. \]

Length from the Dot Product

  • Let \(\vec{u}=\langle u_1,\ldots,u_n \rangle\in\mathbb{R}^n\).
  • By the Pythagorean theorem, \[ \left\lVert \vec{u} \right\rVert=\sqrt{u_1^2+\cdots+u_n^2}. \]
  • Using the dot product, \[ \left\lVert \vec{u} \right\rVert=\sqrt{\vec{u}\!\cdot\!\vec{u}}, \qquad \left\lVert \vec{u} \right\rVert^2=\vec{u}\!\cdot\!\vec{u}. \]

Angle from the Dot Product

  • Let \(\vec{u},\vec{v}\in\mathbb{R}^n\) with \(\vec{u}\ne\vec{0}\) and \(\vec{v}\ne\vec{0}\).
  • By the law of cosines, \[ \vec{u}\!\cdot\!\vec{v}=\left\lVert \vec{u} \right\rVert\,\left\lVert \vec{v} \right\rVert\cos\theta, \] where \(\theta\in[0,\pi]\).
  • Therefore, \[ \cos\theta=\frac{\vec{u}\!\cdot\!\vec{v}}{\left\lVert \vec{u} \right\rVert\,\left\lVert \vec{v} \right\rVert}. \]
  • Note: \(\cos^{-1}\) returns an angle in \([0,\pi]\), so it does not encode orientation.

Idea of the Proof

  • Work in the plane spanned by \(\vec{u}\) and \(\vec{v}\).
  • Replace \(\vec{u},\vec{v}\) by unit vectors \(\dfrac{\vec{u}}{\left\lVert \vec{u} \right\rVert}\) and \(\dfrac{\vec{v}}{\left\lVert \vec{v} \right\rVert}\).
  • Rotate coordinates so \(\dfrac{\vec{u}}{\left\lVert \vec{u} \right\rVert}=\langle 1,0 \rangle\).
  • Then \(\dfrac{\vec{v}}{\left\lVert \vec{v} \right\rVert}=\langle \cos\theta,\sin\theta \rangle\).
  • Compute: \[ \frac{\vec{u}}{\left\lVert \vec{u} \right\rVert}\!\cdot\!\frac{\vec{v}}{\left\lVert \vec{v} \right\rVert} = \langle 1,0 \rangle\!\cdot\!\langle \cos\theta,\sin\theta \rangle = \cos\theta. \]
  • This argument is valid as the dot product is rotaionally invariant.

Example

  • Find the angle between \(\langle 1,0 \rangle\) and \(\langle 1,\sqrt{3} \rangle\).
  • Compute: \[ \vec{u}\!\cdot\!\vec{v}=1,\quad \left\lVert \vec{u} \right\rVert=1,\quad \left\lVert \vec{v} \right\rVert=2. \]
  • Thus \[ \cos\theta=\frac{1}{2}, \qquad \theta=60^\circ. \]

Properties of the Dot Product

  • \(\vec{u}\!\cdot\!\vec{v}=\vec{v}\!\cdot\!\vec{u}\) (commutativity)
  • \(\vec{u}\!\cdot\!(\vec{v}+\vec{w})=\vec{u}\!\cdot\!\vec{v}+\vec{u}\!\cdot\!\vec{w}\) (distributivity)
  • \((c\vec{u})\!\cdot\!\vec{v}=c(\vec{u}\!\cdot\!\vec{v})\) (compatibility with scalars)
  • \(\vec{u}\!\cdot\!\vec{u}\ge 0\), and \(\vec{u}\!\cdot\!\vec{u}=0\) iff \(\vec{u}=\vec{0}\) (positivity)
  • \(\left\lVert \vec{u} \right\rVert^2=\vec{u}\!\cdot\!\vec{u}\) (length from dot product)
  • \(\displaystyle \cos\theta=\frac{\vec{u}\!\cdot\!\vec{v}}{\left\lVert \vec{u} \right\rVert\,\left\lVert \vec{v} \right\rVert}\) (angle from dot product)

Special Cases

  • Two vectors are perpendicular if and only if \[ \vec{u}\!\cdot\!\vec{v}=0. \]
  • If \(\vec{u}\) and \(\vec{v}\) point in the same direction, \[ \vec{u}\!\cdot\!\vec{v}=\left\lVert \vec{u} \right\rVert\,\left\lVert \vec{v} \right\rVert. \]
  • If they point in opposite directions, \[ \vec{u}\!\cdot\!\vec{v}=-\left\lVert \vec{u} \right\rVert\,\left\lVert \vec{v} \right\rVert. \]
  • If \(\theta\) is acute, then \(\vec{u}\!\cdot\!\vec{v}>0\); if obtuse, then \(\vec{u}\!\cdot\!\vec{v}<0\).

Dot Product as Correlation

  • If \(\vec{u}\!\cdot\!\vec{v}\ne0\), then each vector contains a component in the direction of the other.
  • In this sense, the dot product measures how “aligned” (or correlated) two vectors are.
  • The sign matters: positive means aligned, negative means mostly opposite.
  • If \(\vec{u}\!\cdot\!\vec{v}=0\), then movement in one direction has no component in the other — the vectors are not correlated.

Orthogonal Projection

  • Let \(\vec{u},\vec{v}\in\mathbb{R}^n\) be non-zero vectors.
  • Decompose \(\vec{u}\) into two components relative to \(\vec{v}\): \[ \vec{u}=c_1\vec{e}+c_2\vec{n}, \] where \(\vec{e}=\dfrac{\vec{v}}{\left\lVert \vec{v} \right\rVert}\) is the unit vector in the direction of \(\vec{v}\), and \(\vec{n}\) is the unit vector perpendicular to \(\vec{v}\) on the plane \(W=\mathop{\mathrm{span}}(\{\vec{u},\vec{v}\})\).
  • The coefficient \(c_1\) measures the component of \(\vec{u}\) in the direction of \(\vec{v}\).
  • The vector \(c_1\vec{e}\) is called the projection of \(\vec{u}\) onto \(\vec{v}\), denoted by \[ \operatorname{proj}_{\vec{v}}\vec{u}. \]

Orthogonal Projection